#ifndef _VECTOR_H_
#define _VECTOR_H_
#include "public.h"
#include "matrl.h"

typedef union elem_vector elem_type;
typedef int user;

typedef struct _vector
{
    elem_type *buff; // 首元素指针
    int cap;         // 容量
    int size;        // 长度
} vector_dat,*vector;

vector vector_create(int initial_cap);
void vector_clear(vector v);
void vector_destroy(vector v);
void vector_expand_storage(vector v);
void vector_reduce_storage(vector v, unsigned int cap);
void vector_push_back(vector v, elem_type data);
void vector_push_front(vector v, elem_type data);
void vector_insert(vector v, unsigned int pos, elem_type data);

#endif